//
//  FMDBDao.h
//  MyNotes
//
//  Created by chen on 17/4/5.
//  Copyright © 2017年 chen. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FMDatabase.h"
#import "Person.h"
#import "Note.h"
#import "Type.h"

@interface FMDBDao : NSObject
+(instancetype)shareDatabase;
+(instancetype)shareDatabase:(NSString *)dbName;
+(instancetype)shareDatabase:(NSString *)dbName path:(NSString *)dbPath;
-(void)insertData;

-(BOOL)insertNoteData:(Note *)note;
-(NSMutableArray *)readNoteDataByTid:(NSInteger)tid;
-(Note *)readNoteDataByCid:(NSInteger)cid;
-(BOOL)deleteNoteDataByCid:(NSInteger)cid;

-(BOOL)insertTypeData:(Type *)type;
-(NSMutableArray *)readTypeDataByAll;
-(BOOL)deleteTypeDataByTid:(NSInteger)tid;
@end
